package com.cykj.user.util;
import java.util.Random;
/**
 * @BelongsProject: smart_recruit_backend
 * @BelongsPackage: com.cykj.user.util
 * @Author: 张昌煜
 * @CreateTime: 2025-08-18 19:17
 * @Description: TODO
 * @Version: 1.0
 */


public class CaptchaGenerator {

    private static final String SYMBOLS = "0123456789";
    private static final Random RANDOM = new Random();

    public static String generateCaptcha(int length) {
        StringBuilder sb = new StringBuilder(length);
        for (int i = 0; i < length; i++) {
            sb.append(SYMBOLS.charAt(RANDOM.nextInt(SYMBOLS.length())));
        }
        return sb.toString();
    }
}